<?PHP
	Class Pagination{
	
		function __construct(){}
			
		private $recordsPerPage;
		private $pagesPerBlock;	
		private $pagesNumber;
		private $blocksNumber;
		private $recordsNumber;
		private $currentPage;
		private $currentBlock;
		
		public function setRecordsPerPage($recordsPerPage){$this->recordsPerPage = $recordsPerPage;}
		public function getRecordsPerPage(){return $this->recordsPerPage;}
		
		public function setPagesPerBlock($pagesPerBlock){$this->pagesPerBlock = $pagesPerBlock;}
		public function getPagesPerBlock(){return $this->pagesPerBlock;}
		
		public function setPagesNumber($pagesNumber){$this->pagesNumber = $pagesNumber;}
		public function getPagesNumber(){return $this->pagesNumber;}
		
		public function setRecordsNumber($recordsNumber){$this->recordsNumber = $recordsNumber;}
		public function getRecordsNumber(){return $this->recordsNumber;}		
		
		public function setCurrentPage($currentPage){$this->currentPage = $currentPage;}
		public function getCurrentPage(){return $this->currentPage;}
		
		public function setBlocksNumber($blocksNumber){$this->blocksNumber = $blocksNumber;}
		public function getBlocksNumber(){return $this->blocksNumber;}
		
		public function setCurrentBlock($currentBlock){$this->currentBlock = $currentBlock;}
//		public function getCurrentBlock(){return $this->currentBlock;}
		/**
		 * Função copiada do arquivo Pagination.class.php do projeto eventos
		 */
		public function getCurrentBlock(){
			return ceil($this->getCurrentPage() / $this->getPagesPerBlock());
		}
		
		public function calculate(){
			//Calcular a quantidade de páginas
			$this->pagesNumber = ceil($this->recordsNumber / $this->recordsPerPage);
			
			//Calcular a quantidade de blocos
			$this->blocksNumber = ceil($this->pagesNumber / $this->pagesPerBlock);
		}
	}